function areahelper:realizarArea(playername, pos1, pos2, name)
    -- codigo trasladado desde areas.
	-- minetest.log(playername ..  dump(pos1) .. dump(pos2) .. "intenta conseguir un area.")
    local canAdd, errMsg = areas:canPlayerAddArea(pos1, pos2, playername)
    if not canAdd then
        return false, "You can't protect that area: " .. errMsg;
    end
	local nombreArea = "AREA DE " .. playername;
    local id = areas:add(playername, nombreArea, pos1, pos2, nil)
    areas:save()
	minetest.chat_send_player(playername, "Area " .. id .. " creada para " .. playername);
	return true, "";
end



-- sort_pos no necesario, está en areas.
function areahelper.sort_pos(pos1, pos2) 
	pos1 = {x=pos1.x, y=pos1.y, z=pos1.z}
	pos2 = {x=pos2.x, y=pos2.y, z=pos2.z}
	if pos1.x > pos2.x then
		pos2.x, pos1.x = pos1.x, pos2.x
	end
	if pos1.y > pos2.y then
		pos2.y, pos1.y = pos1.y, pos2.y
	end
	if pos1.z > pos2.z then
		pos2.z, pos1.z = pos1.z, pos2.z
	end
	return pos1, pos2;
end

function areahelper.box(pos1, pos2)
    return {pos1.x, pos1.y, pos1.z, pos2.x, pos2.y, pos2.z};
end